/** 
 * @author Huang RuiGuang
 * @date 2008/12/1
 *
 * Herm library
 * Copyright (c) 2008 by Huang RuiGuang(daemon.huang@gmail.com)
 *
 * Permission to use, copy, modify, distribute and sell this software.
 */

#ifndef HERM_FRAMEWORK_COMMON_HANDLER_H
#define HERM_FRAMEWORK_COMMON_HANDLER_H

namespace herm{
    class Buffer;
}

class StreamBuffer;
class CommonHandler
{
public:
	int Fetch(int stateType, herm::Buffer* recvBuf, herm::IMsgHandler* msgHandler,
		int lenSize, char* tmpBuf, char* outBuf, int& len) const;
	int Error(int curState, int stateType, int stateCode);
	int GetMsgSize(herm::Buffer* recvBuf, int lenSize) const;
};

#endif
